package com.tadpole.music.adapter.me;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.tadpole.music.R;
import com.tadpole.music.adapter.base.BaseAdapter;
import com.tadpole.music.bean.me.ZhenTiSearchBean;
import com.tadpole.music.bean.me.ZhenTiStudentErrorBean;
import com.tadpole.music.holder.base.BaseViewHolder;
import com.tadpole.music.holder.me.ZhenTiWork1ViewHolder;
import com.tadpole.music.holder.me.ZhenTiWorkViewHolder;

import java.util.List;

/**
 * Created By 孙岩
 * on 2020/12/26
 */
public class ZhenTiWork1Adapter extends BaseAdapter {
    private Activity activity;
    private ZhenTiWork1ViewHolder zhenTiWorkViewHolder;
    private OnItemClickListener onItemClickListener;
    private List<ZhenTiStudentErrorBean.DataBeanX.DataBean> list;

    public ZhenTiWork1Adapter(Activity activity, List<ZhenTiStudentErrorBean.DataBeanX.DataBean> list){
        this.activity = activity;
        this.list = list;
    }


    @Override
    public BaseViewHolder createRelHolder(ViewGroup parent, int viewType) {
        zhenTiWorkViewHolder = new ZhenTiWork1ViewHolder( LayoutInflater.from(activity).inflate(R.layout.item_v2_work_zhenti, parent, false),list,onItemClickListener);
        return zhenTiWorkViewHolder;
    }

    @Override
    public int getRelItemCount() {
        return list.size();
    }

    @Override
    public void setOnItemClickListener(OnItemClickListener listener) {
        this.onItemClickListener = listener;
    }

    @Override
    public void setOnChildClickListener(OnChildClickListener listener) {

    }

    @Override
    public void setOnLongClickListener(OnLongClickListener listener) {

    }

    @Override
    public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
        holder.init(position - mHeadViews.size());
    }
}
